Backface culling for motion blur and depth of field

ABSTRACT

In order to efficiently backface cull rendering primitives during computer graphics rendering, it is important to be sure that the rendering primitives to be culled are guaranteed to be backfacing even if the primitives are moving or are undergoing defocus blur. Therefore, we derive conservative tests that determine if a moving and defocused triangle is backfacing over an entire time interval and over the area of a lens. In addition, we present tests for the special cases of only motion blur and only depth of field.

BACKGROUND

This relates to graphics processing and, particularly, to motion blur and depth of field rendering.

Motion blur is the effect where moving objects appear blurred when captured with long camera exposure times. Depth of field is the effect that a larger aperture has a shorter focus range, and objects out of focus appear blurred.

One of the most important culling tests is backface culling. Backface culling eliminates rasterization processing of objects that face away from the camera. A rendering primitive can be backface culled if its face normal makes an angle of more than 90 degrees with the camera view vector. By culling these rendering primitives, unnecessary processing may be reduced.

When rendering motion blur and depth of field, an excessive amount of inside or intersection tests can be generated, and therefore, accurate backface culling tests are needed also for these contexts. For moving triangles, where each vertex moves along a line in three dimensions, a moving triangle is commonly assumed to be backfacing over the entire time interval if the triangle is backfacing at the start of the motion and at the end.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a flow chart for one embodiment;

FIG. 2 is a flow chart for another embodiment;

FIG. 3 is a flow chart for yet another embodiment; and

FIG. 4 is a schematic depiction for one embodiment.

DETAILED DESCRIPTION

A triangle where each vertex moves linearly in 3D can be backfacing (i.e. facing away from the camera) at the start of the motion (at t=0), then turn frontfacing, and then (again) backfacing at the end of the motion (at t=1). As a result, the assumption that a triangle whose vertices move linearly in time, is backfacing if the backfacing status is true at the start and end of the interval, is not always correct.

Assume that we have a moving triangle, where the vertices move linearly within a frame, from time t=0 to t=1. At t=0, we denote the vertices q_(i) and at t=1 we call them r_(i). We work in clip space, using 2D homogeneous coordinates (2DH), so a vertex is defined as p=(p_(x),p_(y),p_(w)). A linearly interpolated vertex is then expressed as: p _(i)(t)=(1−t)q _(i) +tr _(i).  (1) Given a moving triangle with vertices (p₀(t),p₁(t),p₂(t)), we form the matrix:

$\begin{matrix} {{{M(t)} = \begin{bmatrix} {p\; 0_{x}} & {p\; 1_{x}} & {p\; 2_{x}} \\ {p\; 0_{y}} & {p\; 1_{y}} & {p\; 2_{y}} \\ {p\; 0_{w}} & {p\; 1_{w}} & {p\; 2_{w}} \end{bmatrix}},} & (2) \end{matrix}$ where we have omitted the temporal dependence for readability. The triangle can be backface culled if det(M)<0, where the determinant is expressed as: det(M)=p ₀·(p ₁ ×p ₂).  (3)

Geometrically, this can be interpreted as a (scaled) signed volume computation of the tetrahedron spanned by the origin and the triangle. Thus, we want to determine if p₀(t)·(p₁(t)×p₂(t))<0 for tε[0,1]. The cross product of two linearly moving vertices can be expanded as: p ₁ ×p ₂=((1−t)q ₁ +tr ₁)×((1−t)q ₂ +tr ₂)=t ² f+tg+h,  (4) where: f=(r ₁ −q ₁)×(r ₂ −q ₂), g=(r ₁ −q ₁)×q ₂−(r ₂ −q ₂)×q ₁, h=q ₁ ×q ₂.  (5) Using this expression, we can derive the time-dependent determinant:

$\begin{matrix} \begin{matrix} {{\det(M)} = {{p_{0}(t)} \cdot \left( {{p_{1}(t)} \times {p_{2}(t)}} \right)}} \\ {= {\left( {{\left( {1 - t} \right)q_{0}} + {tr}_{0}} \right) \cdot \left( {{t^{2}f} + {tg} + h} \right)}} \\ {{= {{at}^{3} + {bt}^{2} + {ct} + d}},} \end{matrix} & (6) \end{matrix}$ where: a=(r ₀ −q ₀)·f, b=(r ₀ −q ₀)g+q ₀ ·f, c=(r ₀ −q ₀)h+q ₀ ·g, d=q ₀ ·h.  (7) Note that the coefficient d=q₀·h=q₀·(q₁×q₂) is the backface test for the triangle at t=0. Also, the value of the polynomial at t=1 is a+b+c+d=r₀·(r₁×r₂), which, analogously, is the backface test at t=1. Finally, note that the expression for the coefficient: a=(r ₀ −q ₀)[(r ₁ −q ₁)×(r ₂ −q ₂)],  (8) is the determinant test for the motion vectors of the three vertices, and if they all lie in the same plane, the cubic term is zero, i.e., a=0. Thus, it is only when the motion vectors span a volume in 2DH that the determinant will be a cubic function.

We note that if the polynomial does not have any roots in tε[0,1] and d<0, then the triangle can be safely backface culled. Given that the backface function is below zero at t=0 and t=1, we can compute the local minimum and maximums of the cubic polynomial, and if we find a local maximum within the interval tε[0,1], we check the value of the cubic polynomial at this point. If it is below zero, we can safely backface cull the triangle. If the motion direction of the three vertices are parallel, the backfacing function is linear.

The coefficient a is the determinant of the triangle's three motion vectors, which are often small or near parallel. Therefore, directly computing the backfacing function on power form (Equation 6) can be numerically unstable. To alleviate this problem, we express the backfacing function on cubic Bernstein form:

$\begin{matrix} {{{b(t)} = {\sum\limits_{i = 0}^{3}{{b_{i}\begin{pmatrix} 3 \\ i \end{pmatrix}}\left( {1 - t} \right)^{3 - i}t^{i}}}},} & (9) \end{matrix}$ with coefficients, b_(i), given by: b ₀ =q ₀·(q ₁ ×q ₂) b ₁=⅓[q ₀·(q ₁ ×r ₂ +r ₁ ×q ₂)+r ₀·(q ₁ ×q ₂)], b ₂=⅓[r ₀·(q ₁ ×r ₂ +r ₁ ×q ₂)+q ₀·(r ₁ ×r ₂)], b ₃ =r ₀·(r ₁ ×r ₂).  (10)

Next, we exploit the convex hull property of the Bernstein basis, and simply check if any of the coefficients, b_(i), iε{0, 1, 2, 3}, are positive. This is a coarser test than testing against the true maximum of the cubic polynomial, but reduces the risk of numerical precision issues. Note that the test can be refined by applying de Casteljau steps to the coefficients and testing the generated coefficients.

A backface test for motion blur on Bernstein form, shown in FIG. 1, begins by testing a triangle at t=0 by computing b₀ (block 12). A check at diamond 14 determines whether b₀ is positive. If so, the triangle is front facing (block 16). Otherwise, the triangle is tested at t=1 by computing b_(n) (block 18). If b_(n) is positive, then the triangle is front facing (block 22). Otherwise, begin a loop by putting the value 1 into i (block 24), and computing b_(i) (block 26). A check at diamond 28 determines if b_(i) is positive. If so, it is front facing (block 30). If not, iterate until i equals n (block 32 and diamond 34) and then report the triangle as backfacing (block 36).

We sketch a practical implementation of the backface culling test for triangles where each vertex moves linearly in time in the pseudo code:

 1 movingTriIsBackfacing(const TimeContTri& tri) {  2 b0 = det(M(t=0))  3 if b0 > 0  4 return false  5 b3 = det(M(t=1))  6 if b3 > 0  7 return false  8 compute b1  9 if b1 > 0 10 return false 11 compute b2 12 if b2 > 0 13 return false 14 return true 15 }

If the triangle vertex motion can be expressed as a polynomial, we can generalize the previous test. We express the motion of each triangle vertex as a Bézier curve of degree n in 2DH:

$\begin{matrix} {{p_{i}(t)} = {\sum\limits_{j = 0}^{n}{b_{j}^{i}{B_{j}^{n}(t)}}}} & (11) \end{matrix}$ The backface test then becomes:

$\begin{matrix} \begin{matrix} {{\det\left( {M(t)} \right)} = {{p_{0}(t)} \cdot \left( {{p_{1}(t)} \times {p_{2}(t)}} \right)}} \\ {= {\sum\limits_{i = 0}^{n}{b_{i}^{0}{{B_{i}^{n}(t)} \cdot \left( {\sum\limits_{j = 0}^{n}{b_{j}^{1}{B_{j}^{n}(t)} \times {\sum\limits_{k = 0}^{n}{b_{k}^{2}{B_{k}^{n}(t)}}}}} \right)}}}} \\ {= {\sum\limits_{i,j,{k = 0}}^{n}{{B_{i}^{n}(t)}{B_{j}^{n}(t)}{B_{k}^{n}(t)}{b_{i}^{0} \cdot \left( {b_{j}^{1} \times b_{k}^{2}} \right)}}}} \\ {= {\sum\limits_{i,j,{k = 0}}^{n}{B_{i + j + k}^{3n}\frac{\begin{pmatrix} n \\ i \end{pmatrix}\begin{pmatrix} n \\ j \end{pmatrix}\begin{pmatrix} n \\ k \end{pmatrix}}{\begin{pmatrix} {3n} \\ {i + j + k} \end{pmatrix}}{b_{i}^{0} \cdot {\left( {b_{j}^{1} \times b_{k}^{2}} \right).}}}}} \end{matrix} & (12) \end{matrix}$ Note that this is a Bézier curve of degree 3n, where the control points are sums of scaled determinants of three control points, one from each of the three curves describing the vertex motion. A conservative backface test can again be derived by using the convex hull property. As expected, we obtain Equation 10 for the linear motion case, i.e., when n=1. A similar derivation can be performed for rational splines.

The test has potential to speed up motion blur rasterization of macro-sized triangles, or small triangles with large motion, where one expensive backface culling test can be amortized over a lot of saved inside tests. If the number of inside tests is small in relation to the overhead of the conservative backface culling test, it may be better to skip the conservative test entirely, as backfacing triangles will be correctly culled in the per-sample inside test. Depending on the workload, the test could be enabled when the triangle sizes or the motion surpasses a threshold value.

Depth of field is a shear in clip space. This shear can be represented by applying the matrix:

$\begin{matrix} {{{S\left( {u,v} \right)} = \begin{pmatrix} 1 & 0 & {{- {Hu}}/J} & {Hu} \\ 0 & 1 & {{- {Iv}}/J} & {Iv} \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \end{pmatrix}},} & (13) \end{matrix}$ to the clip space coordinates of the triangle. H, I and J are constants given by the location of the focal plane, the camera aperture size and the near and far plane. The location on the lens is given by (u,v). Applying this matrix to a the three-dimensional homogeneous vertex (3DH), {circumflex over (p)}_(i)=(p_(ix),p_(iy)p_(iz),p_(iw)), in clip space results in a sheared position, ŝ_(i)(u,v): s _(ix) =p _(ix) −H/Jup _(iz) +Hup _(iw) =p _(ix)+α_(i) u, s _(iy) =p _(iy) −I/Jvp _(iz) +Ivp _(iw) =p _(iy)+β_(i) v, s _(iz) =p _(iz) , s _(iw) =p _(iw)  (14) where α_(i)=H/Jp_(iz)+Hp_(iw) and β_(i)=I/Jp_(iz)+Ip_(iw) are per-vertex values dependent on the p_(iz) and p_(iw) terms. To simplify notation below, we let s_(i)(u,v) and p_(i)(u,v) denote the two-dimensional homogeneous vertices, consisting of the xyw components of ŝ_(i)(u,v) and {circumflex over (p)}_(i) respectively, that is: s _(i)(u,v)=p _(i)+(α_(i) u,β _(i) v,0)=p _(i) +l _(i)(u,v)  (15) Note that: l _(i) ×l _(j) =uv(0,0,α_(i)β_(j)−α_(j)β_(i))=0  (16) since

$\alpha_{i} = {\frac{H}{I}{\beta_{i}.}}$ The backfacing criterion then becomes:

$\begin{matrix} \begin{matrix} {{{\det\left( {M\left( {u,v} \right)} \right)} = {s_{0} \cdot \left( {s_{1} \times s_{2}} \right)}},} \\ {{= {{p_{0} \cdot \left( {p_{1} \times p_{2}} \right)} + {1_{0} \cdot \left( {p_{1} \times p_{2}} \right)}}},{{{+ 1_{1}} \cdot \left( {p_{2} \times p_{0}} \right)} +}} \\ {{1_{2} \cdot \left( {p_{0} \times p_{1}} \right)},} \\ {= {{au} + {bv} + {c.}}} \end{matrix} & (17) \end{matrix}$ The coefficients are given by: a=α ₀(p ₁ ×p ₂)_(x)+α₁(p ₂ ×p ₀)_(x)+α₂(p ₀ ×p ₁)_(x) , b=β ₀(p ₁ ×p ₂)_(y)+β₁(p ₂ ×p ₀)_(y)+β₂(p ₀ ×p ₁)_(y) , c=p ₀·(p ₁ ×p ₂).  (18) We note that some expressions for a and b can be reused for the edge equation setup. As can be seen, the backfacing function for depth of field is a linear function in u and v (Equation 17). The triangle changes its facing when au+bv+c=0. Hence, the triangle will change its facing somewhere on the lens only if there is a solution to the following system of equations: au+bv+c=0, u ² +v ² <R ²,  (19) where the last equation checks whether the lens position, (u,v), is inside a circular lens with radius, R. Geometrically, this is an intersection between a circle and a line, which has a solution only if:

$\begin{matrix} {\frac{c^{2}}{a^{2} + b^{2}} < {R^{2}.}} & (20) \end{matrix}$

Consequently, if we can prove that the above does not hold, there are no face changes when moving over the lens. Intuitively, the triangle will not change facing over the lens if the triangle's plane equation (in three dimensions) does not intersect with the shape of the lens.

Finally, note that if the triangle's face normal is aligned with the view vector, we have p_(iz)=p_(jz) and p_(iw)=p_(jw), and therefore α_(i)=α_(j) and β_(i)=β_(j), which leads to a=b=0. This means that facing will not change over the lens, as expected.

To determine if a static triangle can be backface culled, we start with computing the backface status at the at the middle of the lens (u=v=0), FIG. 2, block 42. If c>0 (FIG. 2, diamond 44), the triangle may be frontfacing for some time at the center of the lens, and therefore our test is terminated since the triangle is not (conservatively) backfacing for all lens positions (FIG. 2, block 46). Otherwise, compute a²+b² (FIG. 2, block 48) and test whether c²<R²(a²+b²) (block 50 and diamond 52). That is, the triangle can be conservatively backface culled (FIG. 2, block 56) when: c<0, and c ² ≧>R ²(a ² +b ²)  (21) Otherwise, the triangle is front facing (block 54).

By multiplying the moving vertex in Equation 1 with the shear matrix, S, in Equation 13, the resulting vertex displacement from motion and depth of field, o(u,v,t), is obtained:

$\begin{matrix} \begin{matrix} {{o_{i}\left( {u,v,t} \right)} = {{S\left( {u,v} \right)}{p_{i}(t)}}} \\ {{= {{S\left( {u,v} \right)}\left( {{\left( {1 - t} \right)q_{i}} + {tr}_{i}} \right)}},} \\ {{= \left( {{{p_{ix}(t)} + {{\alpha_{i}(t)}u}},{{p_{iy}(t)} + {{\beta_{i}(t)}v}},{p_{iw}(t)}} \right)},} \end{matrix} & (22) \end{matrix}$ where α_(i)(t)=H/Jp_(iz)(t)+Hp_(iw)(t) and β_(i)(t)=I/Jp_(iz)(t)+Ip_(iw)(t) are linear functions in t.

The corresponding backface test from Equation 21 is now expressed as:

$\begin{matrix} \begin{matrix} {{\det\left( {M\left( {u,v,t} \right)} \right)} = {o_{0} \cdot \left( {o_{1} \times o_{2}} \right)}} \\ {= {{{a(t)}u} + {{b(t)}v} + {{c(t)}.}}} \end{matrix} & (23) \end{matrix}$

The coefficients a(t), b(t), and c(t) are cubic functions in t.

The triangle can be conservatively backface culled when: c(t)<0,tε[0,1] and c ²(t)>R ²(a ²(t)+b ²(t)),tε[0,1].  (24) Otherwise, the triangle is front facing (block 54).

A conservative test can be obtained by using interval arithmetic. We denote an interval as {circumflex over (x)}=[x, x], where x is its lower bound and x is the upper boundary. The idea is then to minimize the expression to the left of the greater than sign in Equation 24, and to maximize the expression to the right. This results in: c ² R ²(max( a ² ,ā ²)+max(bb ² , b ²)),  (25) where we used c<0

min(c ², c ²)= c ²). So, if c<0 and Equation 25 hold, the triangle, moving in time and over the lens, can be conservatively backface culled. The cubic polynomials a(t), b(t) and c(t) can be converted from power form to Bernstein form, and then we use the convex hull property of the Bernstein control points for conservative culling, similar to what we did previously for motion blurred primitives.

If we approximate the lens with a square with side length R, we get a coarser test given by the equations: au+bv+c=0, |u|<R,|v|<R,  (26) which is a line against box test. Again, we start by testing whether ĉ<0, i.e., whether the triangle is backfacing on the center of the lens. Then, if the four corners of the (square) lens all are on the same side of the swept line, we can conservatively cull the triangle. These four conditions are given by: max(±R(a±b)±c)<0.  (27) Note that the expressions a, b and c are cubic polynomials in t. Unlike the interval analysis test given for the circular lens, we can, for each of the four equations, compute the coefficients for a single cubic equation and bound it, therefore retaining the correlation between the power coefficients for tighter bounds. This may be more efficient for motion with large non-linear coefficients.

Next, we sketch a practical implementation of the backface culling test for motion blurred and defocused triangles. We first note that a coarse, but fast approximation of a²(t)+b²(t) is given by: max(a ² +b ²)≦max( a ² ,ā ²)+max( b ² , b ²),  (28) which essentially is a Manhattan distance approximation.

However, we will instead bound the cubic functions using first-order Taylor models, since the correlation in the linear terms can be preserved, which in turn can give tighter bounds. We also note that the t³ and t² terms of the polynomial a(t) and b(t) are very close to zero for most triangles. This implies that the a(t), b(t) and c(t) terms in Equation 23 are approximately linear, but it also means that care must be taken to avoid precision issues. By using first-order Taylor models, we ensure stability when the t³ and t² terms are small. For an arbitrary cubic polynomial, this is done as shown below: k ₃ t ³ +k ₂ t ² +k ₁ t+k ₀ ≈k ₁ t+k ₀ +{circumflex over (r)} _(k),  (29) where {circumflex over (r)} is a remainder interval, which bounds the quadratic and cubic terms: {circumflex over (r)} _(k) =[−|k ₃ |−|k ₂ |,|k ₃ |+|k ₂|].  (30)

We use this to conservatively express a²(t)+b²(t) as: a ²(t)+b ²(t)≈(a ₁ t+a ₀ +{circumflex over (r)} _(a))²+(b ₁ t+b ₀ +{circumflex over (r)} _(b))².  (31) The upper bound is given by: a ₁ ² +b ₁ ²max(0,a ₀ a ₁ +b ₀ b ₁)+a ₀ ² +b ₀ ² + r _(a) ₂ _(+b) ₂ ,  (32) where r _(a) ₂ _(+b) ₂ is a linear function in the remainder intervals {circumflex over (r)}_(a) and {circumflex over (r)}_(b). Note that if a(t) and b(t) are linear in t,{circumflex over (r)}_(a)={circumflex over (r)}_(b)=0, which gives r _(a) ₂ _(+b) ₂ =0, so Equation 32 is exact in that case. We use the backface test for motion blur (on Bernstein basis) to determine the backface status at the center of the lens as described above.

The final test is given by the conditions in Equation 34, where a²(t)+b²(t) is bounded using Equation 32.

Referring to FIG. 3, a sequence for implementing a backface test for both depth of field and motion blur begins by testing a triangle at the center of the lens, as indicated in block 62 of FIG. 3. This is done by computing and bounding the maximum of c(t). Next, a check at diamond 64 determines whether max[c(t)] is greater than zero. If it is, then the triangles are reported as front facing, as indicated in block 66.

Otherwise, at block 68, the max[a(t)²+b(t)²] is computed and bounded, as indicated in block 68. Next, a test is done to determine if the minimum of c² is greater than R²max[a(t)²+b(t)²], as indicated in block 70. If so, at diamond 72, the triangle is reported as front facing, as indicated in block 74 and, otherwise, it is reported as backfacing in block 76.

We will derive a backface culling test for motion blur where rasterization is done in screen space. For screen-space rasterization, a common backface test is given by the sign of the screen-space area of the triangle. A projective transform maps lines to lines, so the motion vectors are still lines after projection. However, the acceleration along the line is different due to perspective foreshortening. Let us define two edges of the projected triangle as:

$\begin{matrix} {{e_{1} = {\frac{p_{1}(t)}{p_{1w}(t)} - \frac{p_{0}(t)}{p_{0w}(t)}}},{{e_{2}(t)} = {\frac{p_{2}(t)}{p_{2w}(t)} - {\frac{p_{0}(t)}{p_{0w}(t)}.}}}} & (34) \end{matrix}$ Twice the signed area can now be expressed as:

$\begin{matrix} \begin{matrix} {{{A(t)} = {{e_{1}(t)} \times {e_{2}(t)}}},} \\ {{= {{\frac{p_{0}}{p_{0w}} \times \frac{p_{1}}{p_{1w}}} + {\frac{p_{1}}{p_{1w}} \times \frac{p_{2}}{p_{2w}}} + {\frac{p_{2}}{p_{2w}} \times \frac{p_{0}}{p_{0w}}}}},} \\ {= \frac{{p_{2w}p_{0} \times p_{1}} + {p_{0w}p_{1} \times p_{2}} + {p_{1w}p_{2} \times p_{0}}}{p_{0w}p_{1w}p_{2w}}} \end{matrix} & (35) \end{matrix}$

Recall that each vertex is a function of t (Equation 1), which results in that the backface test in screen space is a cubic rational function in t. The triangle moves in a plane, but the vertex positions are no longer linearly interpolated in t and the triangle can change facing at most three times.

Furthermore, the magnitude of the denominator p₀ _(w) p₁ _(w) p₂ _(w) is irrelevant for the area test, so if we know the signs of the w components after clipping, the denominator can be skipped, resulting in a cubic polynomial, similar to the homogeneous case, as expected.

On the other hand, if we assume linear motion in screen space, the area function becomes a quadratic polynomial, so even in this case, the moving triangle can be backfacing at t=0 and t=1, and still be frontfacing somewhere in between.

Our techniques apply to real-time and offline rendering, and to both stochastic point sampling and analytical visibility methods. The rendering errors introduced by the previous technique can easily be detected in extreme cases, but in the majority of cases, these generate reasonable images, where the error is hard to detect.

The computer system 130, shown in FIG. 4, may include a hard drive 134 and a removable medium 136, coupled by a bus 104 to a chipset core logic 110. A keyboard and mouse 120, or other conventional components, may be coupled to the chipset core logic via bus 108. The core logic may couple to the graphics processor 112, via a bus 105, and the main or host processor 100 in one embodiment. The graphics processor 112 may also be coupled by a bus 106 to a frame buffer 114. The frame buffer 114 may be coupled by a bus 107 to a display screen 118. In one embodiment, a graphics processor 112 may be a multi-threaded, multi-core parallel processor using single instruction multiple data (SIMD) architecture.

In the case of a software implementation, the pertinent code may be stored in any suitable semiconductor, magnetic, or optical memory, including the main memory 132 or any available memory within the graphics processor. Thus, in one embodiment, the code to perform the sequences of FIGS. 1-3 may be stored in a machine or computer readable medium, such as the memory 132 or the graphics processor 112, and may be executed by the processor 100 or the graphics processor 112 in one embodiment.

FIGS. 1-3 are flow charts. In some embodiments, the sequences depicted in these flow charts may be implemented in hardware, software, or firmware. In a software embodiment, a non-transitory computer readable medium, such as a semiconductor memory, a magnetic memory, or an optical memory may be used to store instructions and may be executed by a processor to implement the sequences shown in FIGS. 1-3.

The graphics processing techniques described herein may be implemented in various hardware architectures. For example, graphics functionality may be integrated within a chipset. Alternatively, a discrete graphics processor may be used. As still another embodiment, the graphics functions may be implemented by a general purpose processor, including a multicore processor.

References throughout this specification to “one embodiment” or “an embodiment” mean that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one implementation encompassed within the present invention. Thus, appearances of the phrase “one embodiment” or “in an embodiment” are not necessarily referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be instituted in other suitable forms other than the particular embodiment illustrated and all such forms may be encompassed within the claims of the present application.

While the present invention has been described with respect to a limited number of embodiments, those skilled in the art will appreciate numerous modifications and variations therefrom. It is intended that the appended claims cover all such modifications and variations as fall within the true spirit and scope of this present invention. 

What is claimed is:
 1. A method comprising: determining, using a computer, the sign of a determinant of vertices on a triangle undergoing motion blur and depth of field, including determining the sign of a determinant of vertices of a triangle where, for each vertex, the depth of field effect can be represented by a function of two lens coordinates u and v and the vertex motion represented by a function of time; and based on said sign, deciding whether to backface cull the triangle.
 2. The method of claim 1 including determining the sign of a determinant of vertices on a triangle where each vertex moves according to a polynomial function in time.
 3. The method of claim 2 including determining the sign of a determinant of vertices on a triangle where each vertex moves linearly in time.
 4. The method of claim 2 including determining the sign of Bernstein coefficients and using the sign to determine if a triangle can be backface culled.
 5. The method of claim 2 including determining if a moving triangle can change facing for single viewpoint.
 6. The method of claim 1 including determining if a static triangle changes facing for any viewpoint within a lens.
 7. The method of claim 1 including bounding the polynomial of an equation for the determinant using bounded arithmetic.
 8. The method of claim 1 including approximating a lens with a square.
 9. The method of claim 1 including determining whether a triangle can be culled by first checking backface status at the middle of a lens and only if the triangle is backfacing at the center of the lens, proceeding with the full backface test, otherwise reporting that the triangle is potentially visible.
 10. A non-transitory computer readable medium storing instructions to enable a computer to: determine, using a computer, the sign of a determinant of vertices of a triangle undergoing motion blur and depth of field, including determining the sign of a determinant of vertices of a triangle where, for each vertex, the depth of field effect can be represented by a function of two lens coordinates u and v and the vertex motion represented by a function of time; and based on said sign, decide whether to backface cull the triangle.
 11. The medium of claim 10 further storing instructions to determine the sign of a determinant of vertices of a triangle where each vertex moves according to the polynomial function in time.
 12. The medium of claim 11 further storing instructions to determine the sign of a determinant of vertices of a triangle where each vertex moves linearly in time.
 13. The medium of claim 11 further storing instructions to determine the sign of Bernstein coefficients and use the sign to determine if a triangle can be backface culled.
 14. The medium of claim 11 further storing instructions to determine if a moving triangle can change facing for a single viewpoint.
 15. The medium of claim 10 further storing instructions to determine if a static triangle changes facing for any viewpoint within a lens.
 16. The medium of claim 10 further storing instructions to bound the polynomial of an equation for the determinant using bounded arithmetic.
 17. The medium of claim 10 further storing instructions to approximate the lens with the square.
 18. The medium of claim 10 further storing instructions to determine whether a triangle can be culled by first checking backface status at the middle of a lens and only if the triangle is backfacing at the center of the lens, proceed with the full backface test, otherwise report that the triangle is potentially visible.
 19. An apparatus comprising: a processor to determine, using a computer, the sign of a determinant of vertices of a triangle undergoing motion blur and depth of field and, based on the sign, to decide whether to backface cull the triangle, said processor to determine the sign of a determinant of vertices of a triangle where, for each vertex, the depth of field effect can be represented by a function of two lens coordinates u and v and the vertex motion represented by a function of time; and a memory coupled to said processor.
 20. The apparatus of claim 19 wherein said apparatus is a graphics processor.
 21. The apparatus of claim 19, said processor to determine the sign of the determinant where each vertex moves according to a polynomial function in time.
 22. The apparatus of claim 21, said processor to determine the sign of the determinant of vertices of a triangle where each vertex moves linearly in time.
 23. The apparatus of claim 21, said processor to determine the sign of Bernstein coefficients and use the sign to determine if a triangle can be backface culled.
 24. The apparatus of claim 21, said processor to determine if a moving triangle can change facing for a single viewpoint.
 25. The apparatus of claim 19, said processor to determine if a static triangle changes facing for any viewpoint within a lens.
 26. The apparatus of claim 19, said processor to bound the polynomial of an equation for the determinant using bounded arithmetic. 